<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css制作警报灯</title>
    <style>
        .alarmLamp{
            width: 200px;
            height: 300px;
            background-color: red;
            border-radius: 42% 42% 10% 10%;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }
        .lamp{
            width: 300px;
            height: 300px;
            animation-name: lamp;
            animation-iteration-count: infinite;
            animation-duration: 0.5s;
            animation-direction: alternate;
            animation-timing-function: ease;
            animation-play-state: running;
            background-image: radial-gradient(yellow,red);
        }
        @keyframes lamp {
            0%{
                opacity: 0.9;
            }
            50%{
                opacity: 0.5;
            }
            100%{
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="alarmLamp">
        <div class="lamp"></div>
    </div>
</body>
</html>